package com.yootk.action;

import com.yootk.service.IMessageService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.SpringServletContainerInitializer;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.context.WebApplicationContext;

import java.util.HashMap;
import java.util.Map;

@Controller // 控制层注解
public class ContextAction {
    private static final Logger LOGGER = LoggerFactory.getLogger(ContextAction.class);
    @Autowired
    private WebApplicationContext applicationContext ;
    @RequestMapping("/pages/context/show") // 映射地址
    public String show() {
        LOGGER.info("【子容器】，id = {},name=", this.applicationContext.getId(),this.applicationContext.getApplicationName()); // 日志输出
        LOGGER.info("【父容器】，id = {},name=", this.applicationContext.getParent().getId(),this.applicationContext.getParent().getApplicationName()); // 日志输出

        return null;// 路径跳转
    }
}